package com.zxl.singleton;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;


public class Singleton {
	private static Singleton singleton ;
	Lock lock = new ReentrantLock();
	//˽�л����췽��
	private Singleton(){
	}
	
	//�����ṩһ����ȡʵ��ķ���
	
	public Singleton getInstance(){
		if (singleton == null) {
			lock.lock();
			if(singleton == null){
				singleton = new Singleton();
			}
			lock.unlock();
		}
		return singleton;
	}
}
